package com.googlecode.jlsf.swing;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;

/**
 * Some Swing useful tools
 */
public class SwingUtils 
{
	public static void moveToCenter(Window win)
    {
        Dimension size = win.getSize();

        int x = (Toolkit.getDefaultToolkit().getScreenSize().width / 2) - size.width / 2;
        int y = (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - size.height / 2;

        win.setLocation(x, y);
    }
}
